package com.zyong.design.pattern.visitor.case1;

/**
 * @program: zyong-design-pattern
 * @ClassName: ConcreteVisitor
 * @author: zyong
 * @create: 2024-03-28 23:23
 */
public class ConcreteVisitor implements Visitor {
    @Override
    public void operate(ConcreteElementA concreteElementA) {
        String name = concreteElementA.getName();
        System.out.println("ConcreteElementA name = " + name);
    }

    @Override
    public void operate(ConcreteElementB concreteElementB) {
        int age = concreteElementB.getAge();
        System.out.println("ConcreteElementB age = " + age);
    }
}
